{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "8c5b4c0a",
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/home/pmo/miniconda3/envs/BNN/lib/python3.9/site-packages/tqdm/auto.py:21: TqdmWarning: IProgress not found. Please update jupyter and ipywidgets. See https://ipywidgets.readthedocs.io/en/stable/user_install.html\n",
      "  from .autonotebook import tqdm as notebook_tqdm\n"
     ]
    }
   ],
   "source": [
    "import os, math, random\n",
    "import numpy as np\n",
    "import pandas as pd\n",
    "from typing import Tuple\n",
    "\n",
    "import torch\n",
    "import torch.nn as nn\n",
    "import torch.nn.functional as F\n",
    "from torch.utils.data import Dataset, DataLoader\n",
    "from sklearn.model_selection import KFold\n",
    "from sklearn.preprocessing import StandardScaler\n",
    "from sklearn.metrics import accuracy_score, f1_score"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "d75165a0",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Device: cuda\n"
     ]
    }
   ],
   "source": [
    "# -------------------------- 1. 初始化设置（与原代码一致）--------------------------\n",
    "SEED = 42\n",
    "random.seed(SEED); np.random.seed(SEED); torch.manual_seed(SEED)\n",
    "DEVICE = torch.device('cuda' if torch.cuda.is_available() else 'cpu')\n",
    "print(\"Device:\", DEVICE)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "a8ba5a26",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "<class 'pandas.core.frame.DataFrame'>\n",
      "RangeIndex: 976 entries, 0 to 975\n",
      "Data columns (total 48 columns):\n",
      " #   Column                                 Non-Null Count  Dtype  \n",
      "---  ------                                 --------------  -----  \n",
      " 0   Activate Ester_E HOMO (eV)             976 non-null    float64\n",
      " 1   Activate Ester_E LUMO (eV)             976 non-null    float64\n",
      " 2   Activate Ester_Dipole (debye)          976 non-null    float64\n",
      " 3   Activate Ester_Acc. Area (Å²)          976 non-null    float64\n",
      " 4   Activate Ester_Max ElPot (kJ/mol)      976 non-null    float64\n",
      " 5   Activate Ester_Min ElPot (kJ/mol)      976 non-null    float64\n",
      " 6   Activate Ester_Min LocIonPot (kJ/mol)  976 non-null    float64\n",
      " 7   Activate Ester_Polar Area(75) (Å²)     976 non-null    float64\n",
      " 8   Activate Ester_Log P                   976 non-null    float64\n",
      " 9   Activate Ester_Polarizability          976 non-null    float64\n",
      " 10  Activate Ester_Mulliken(Hx)            976 non-null    float64\n",
      " 11  Activate Ester_ExposedArea(Hx) (Å²)    976 non-null    float64\n",
      " 12  Activate Ester_Electrostatic(Cx)       976 non-null    float64\n",
      " 13  Activate Ester_Mulliken(Cx)            976 non-null    float64\n",
      " 14  Activate Ester_Natural(Cx)             976 non-null    float64\n",
      " 15  Activate Ester_ChemShift(Cx)           976 non-null    float64\n",
      " 16  Activate Ester_ExposedArea(Cx) (Å²)    976 non-null    float64\n",
      " 17  Activate Ester_Length(Bondx) Å         976 non-null    float64\n",
      " 18  Activate Ester_Mulliken(Cy)            976 non-null    float64\n",
      " 19  Activate Ester_Natural(Cy)             976 non-null    float64\n",
      " 20  Activate Ester_ChemShift(Cy)           976 non-null    float64\n",
      " 21  Activate Ester_ExposedArea(Cy) (Å²)    976 non-null    float64\n",
      " 22  Activate Ester_Electrostatic(Ox)       976 non-null    float64\n",
      " 23  Activate Ester_Mulliken(Ox)            976 non-null    float64\n",
      " 24  Activate Ester_Natural(Ox)             976 non-null    float64\n",
      " 25  Activate Ester_ChemShift(Ox)           976 non-null    float64\n",
      " 26  Activate Ester_ExposedArea(Ox) (Å²)    976 non-null    float64\n",
      " 27  Activate Ester_Electrostatic(Oy)       976 non-null    float64\n",
      " 28  Activate Ester_Mulliken(Oy)            976 non-null    float64\n",
      " 29  Activate Ester_ChemShift(Oy)           976 non-null    float64\n",
      " 30  Activate Ester_ExposedArea(Oy) (Å²)    976 non-null    float64\n",
      " 31  Activate Ester_Length(Bondz) Å         976 non-null    float64\n",
      " 32  Activate Ester_Length(Bondw) Å         976 non-null    float64\n",
      " 33  Activate Ester_Mulliken(Bondw)         976 non-null    float64\n",
      " 34  Base-pKa                               976 non-null    float64\n",
      " 35  Base-Dipole (debye)                    976 non-null    float64\n",
      " 36  Base-Acc. Area (Å²)                    976 non-null    float64\n",
      " 37  Base-Log P                             976 non-null    float64\n",
      " 38  Base-Electrostatic(Nx)                 976 non-null    float64\n",
      " 39  Base-Mulliken(Nx)                      976 non-null    float64\n",
      " 40  Solvent_Refractive index               976 non-null    float64\n",
      " 41  Solvent_Dielectric constant            976 non-null    float64\n",
      " 42  Solvent_Melting point (°C)             976 non-null    int64  \n",
      " 43  Solvent_Boiling point (°C)             976 non-null    int64  \n",
      " 44  Solvent_Viscosity (cP)                 976 non-null    float64\n",
      " 45  Solvent_logP (partition coeff.)        976 non-null    float64\n",
      " 46  Solvent_HBD                            976 non-null    float64\n",
      " 47  label.1                                976 non-null    int64  \n",
      "dtypes: float64(45), int64(3)\n",
      "memory usage: 366.1 KB\n"
     ]
    }
   ],
   "source": [
    "# -------------------------- 2. 数据读取与预处理（分类任务适配）--------------------------\n",
    "# 读取数据（需确保Excel中存在分类标签列，此处假设标签列为'class_label'）\n",
    "exp_file = \"/home/pmo/linhan/attention-based-model/project/Dataset.xlsx\"\n",
    "exp_sheet = \"exp\"                                \n",
    "df = pd.read_excel(exp_file, exp_sheet, header = 0)\n",
    "df = df.iloc[:,7:]  # 保留第14列后的数据\n",
    "df.info(verbose=True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "id": "0622fcf4",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 分类任务核心：分离特征与【分类标签】（需替换为你的实际标签列名）\n",
    "LABEL_COL = 'label.1'  # ！！关键：替换为你的分类标签列名（如是否活性、类别1/2/3）\n",
    "feature_cols = [c for c in df.columns if c != LABEL_COL]\n",
    "X = df[feature_cols].values.astype(np.float32)\n",
    "y = df[LABEL_COL].values.astype(np.int64)  # 分类标签用int64（适配PyTorch交叉熵）"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "id": "424ac60f",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "X shape: (976, 47), y shape: (976,)\n",
      "Label distribution: [588 388]\n",
      "Number of classes: 2\n"
     ]
    }
   ],
   "source": [
    "# 检查标签分布（确保分类任务合理性）\n",
    "print(f\"X shape: {X.shape}, y shape: {y.shape}\")\n",
    "print(f\"Label distribution: {np.bincount(y)}\")  # 输出每个类别的样本数\n",
    "num_classes = len(np.unique(y))  # 自动获取类别数（无需手动指定）\n",
    "print(f\"Number of classes: {num_classes}\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "id": "51659422",
   "metadata": {},
   "outputs": [],
   "source": [
    "# -------------------------- 3. 数据集类（分类任务无需修改，仅传递标签）--------------------------\n",
    "class TabDataset(Dataset):\n",
    "    def __init__(self, X: np.ndarray, y: np.ndarray):\n",
    "        self.X = torch.from_numpy(X)\n",
    "        self.y = torch.from_numpy(y)  # 分类标签为int64，无需reshape\n",
    "    \n",
    "    def __len__(self):\n",
    "        return len(self.X)\n",
    "    \n",
    "    def __getitem__(self, idx):\n",
    "        return self.X[idx], self.y[idx]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "id": "0d22652a",
   "metadata": {},
   "outputs": [],
   "source": [
    "# -------------------------- 4. 模型定义（核心修改：回归→分类，新增注意力权重提取）--------------------------\n",
    "class FeatureAttention(nn.Module):\n",
    "    \"\"\"特征注意力模块（不变）：输出特征权重w，用于后续关键参数筛选\"\"\"\n",
    "    def __init__(self, d_in: int, hidden: int = 32):\n",
    "        super().__init__()\n",
    "        self.net = nn.Sequential(\n",
    "            nn.Linear(d_in, hidden),\n",
    "            nn.ReLU(),\n",
    "            nn.Linear(hidden, d_in),\n",
    "            nn.Sigmoid()  # 权重w∈[0,1]，值越大表示特征越重要\n",
    "        )\n",
    "    \n",
    "    def forward(self, x):\n",
    "        w = self.net(x)  # (B, d_in)：每个样本的特征权重\n",
    "        return x * w, w  # ！！新增：返回加权后特征 + 原始权重w（用于后续分析）"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "id": "3e8627d5",
   "metadata": {},
   "outputs": [],
   "source": [
    "class ClassifierWithAttention(nn.Module):\n",
    "    \"\"\"分类模型（原回归模型修改）：输出类别概率，保留特征注意力\"\"\"\n",
    "    def __init__(self, d_in: int, num_classes: int, width: int = 64, p_drop: float = 0.2):\n",
    "        super().__init__()\n",
    "        self.attn = FeatureAttention(d_in, hidden=32)  # 特征注意力模块\n",
    "        self.mlp = nn.Sequential(\n",
    "            nn.Linear(d_in, width),\n",
    "            nn.ReLU(),\n",
    "            nn.Dropout(p_drop),\n",
    "            nn.Linear(width, width),\n",
    "            nn.ReLU(),\n",
    "            nn.Dropout(p_drop),\n",
    "        )\n",
    "        # ！！核心修改：回归输出（mu/log_var）→ 分类输出（类别概率）\n",
    "        self.head = nn.Linear(width, num_classes)  # 输出维度=类别数\n",
    "    \n",
    "    def forward(self, x):\n",
    "        # ！！新增：获取注意力权重w\n",
    "        x_attended, attn_weights = self.attn(x)  # x_attended：加权后特征；attn_weights：(B, d_in)\n",
    "        h = self.mlp(x_attended)\n",
    "        logits = self.head(h)  # 分类logits（未经过softmax）\n",
    "        return logits, attn_weights  # ！！返回logits（用于损失计算）+ 注意力权重（用于分析）"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "id": "2d66e896",
   "metadata": {},
   "outputs": [],
   "source": [
    "# -------------------------- 5. 训练函数（核心修改：损失函数、评估指标）--------------------------\n",
    "def train_one_fold(X_tr, y_tr, X_val, y_val, feature_names, num_classes, \n",
    "                   epochs=300, batch_size=32, lr=1e-3, patience=30):\n",
    "    # 1. 特征标准化（与原代码一致）\n",
    "    scaler = StandardScaler().fit(X_tr)\n",
    "    X_tr_s = scaler.transform(X_tr)\n",
    "    X_val_s = scaler.transform(X_val)\n",
    "\n",
    "    # 2. 构建数据加载器（与原代码一致）\n",
    "    ds_tr = TabDataset(X_tr_s, y_tr)\n",
    "    ds_val = TabDataset(X_val_s, y_val)\n",
    "    dl_tr = DataLoader(ds_tr, batch_size=batch_size, shuffle=True, drop_last=False)\n",
    "    dl_val = DataLoader(ds_val, batch_size=256, shuffle=False, drop_last=False)\n",
    "\n",
    "    # 3. 初始化分类模型（替换原回归模型）\n",
    "    model = ClassifierWithAttention(\n",
    "        d_in=X_tr.shape[1], \n",
    "        num_classes=num_classes,  # 分类任务需传入类别数\n",
    "        width=64, \n",
    "        p_drop=0.2\n",
    "    ).to(DEVICE)\n",
    "    opt = torch.optim.Adam(model.parameters(), lr=lr, weight_decay=1e-4)\n",
    "    criterion = nn.CrossEntropyLoss()  # ！！核心修改：回归NLL→分类交叉熵损失\n",
    "\n",
    "    # 4. 训练循环（评估指标改为分类指标）\n",
    "    best_acc, best_state, wait = 0.0, None, 0  # 回归MAE→分类准确率（越高越好）\n",
    "\n",
    "    for ep in range(1, epochs+1):\n",
    "        # 训练阶段\n",
    "        model.train()\n",
    "        tr_loss = 0.0\n",
    "        for xb, yb in dl_tr:\n",
    "            xb, yb = xb.to(DEVICE), yb.to(DEVICE)\n",
    "            logits, _ = model(xb)  # 训练时暂不关注注意力权重\n",
    "            loss = criterion(logits, yb)  # 交叉熵损失计算\n",
    "            opt.zero_grad(); loss.backward(); opt.step()\n",
    "            tr_loss += loss.item() * len(xb)\n",
    "        tr_loss /= len(ds_tr)\n",
    "\n",
    "        # 验证阶段（评估准确率、F1）\n",
    "        model.eval()\n",
    "        with torch.no_grad():\n",
    "            y_pred_list, y_true_list = [], []\n",
    "            for xb, yb in dl_val:\n",
    "                xb = xb.to(DEVICE)\n",
    "                logits, _ = model(xb)\n",
    "                y_pred = torch.argmax(logits, dim=1).cpu().numpy()  # logits→类别（取概率最大）\n",
    "                y_pred_list.append(y_pred)\n",
    "                y_true_list.append(yb.numpy())\n",
    "        \n",
    "        # 计算分类指标\n",
    "        y_pred = np.concatenate(y_pred_list)\n",
    "        y_true = np.concatenate(y_true_list)\n",
    "        val_acc = accuracy_score(y_true, y_pred)  # 准确率\n",
    "        val_f1 = f1_score(y_true, y_pred, average='weighted')  # 加权F1（适配多分类）\n",
    "\n",
    "        # 早停机制（基于准确率）\n",
    "        if val_acc > best_acc + 1e-4:\n",
    "            best_acc = val_acc\n",
    "            best_state = {k: v.cpu().clone() for k, v in model.state_dict().items()}\n",
    "            wait = 0\n",
    "        else:\n",
    "            wait += 1\n",
    "\n",
    "        # 日志输出（替换为分类指标）\n",
    "        if ep % 25 == 0 or ep == 1:\n",
    "            print(f\"[Epoch {ep:03d}] train_loss={tr_loss:.4f}  val_acc={val_acc:.4f}  val_f1={val_f1:.4f} (best acc {best_acc:.4f})\")\n",
    "\n",
    "        if wait >= patience:\n",
    "            print(f\"Early stop at epoch {ep}, best val Acc={best_acc:.4f}\")\n",
    "            break\n",
    "\n",
    "    # 5. 加载最佳模型，计算【全局特征注意力权重】（核心：筛选Top5参数）\n",
    "    model.load_state_dict(best_state)\n",
    "    model.eval()\n",
    "    with torch.no_grad():\n",
    "        # 用全量验证集计算平均注意力权重（单一样本权重有波动，取平均更稳定）\n",
    "        all_attn_weights = []\n",
    "        for xb, _ in dl_val:\n",
    "            xb = xb.to(DEVICE)\n",
    "            _, attn_w = model(xb)  # 获取当前批次的注意力权重\n",
    "            all_attn_weights.append(attn_w.cpu().numpy())\n",
    "        \n",
    "        # 计算每个特征的【平均权重】（按特征维度取均值）\n",
    "        avg_attn_weights = np.concatenate(all_attn_weights).mean(axis=0)  # (d_in,)\n",
    "        # 排序：获取Top5权重对应的特征索引和名称\n",
    "        top5_idx = np.argsort(avg_attn_weights)[-5:][::-1]  # 倒序：权重从大到小\n",
    "        top5_features = [feature_names[i] for i in top5_idx]\n",
    "        top5_weights = avg_attn_weights[top5_idx]\n",
    "\n",
    "    # 输出当前折的Top5关键参数\n",
    "    print(f\"\\n[Fold Best] Top5 Important Features (Attention Weight):\")\n",
    "    for i, (feat, w) in enumerate(zip(top5_features, top5_weights), 1):\n",
    "        print(f\"  {i}. {feat}: {w:.4f}\")\n",
    "\n",
    "    return model, scaler, best_acc, top5_features, top5_weights  # ！！返回Top5特征信息"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "id": "ddd2c349",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      "==================== Fold 1 ====================\n",
      "[Epoch 001] train_loss=0.6541  val_acc=0.5663  val_f1=0.4095 (best acc 0.5663)\n",
      "[Epoch 025] train_loss=0.2156  val_acc=0.7755  val_f1=0.7714 (best acc 0.8112)\n",
      "Early stop at epoch 41, best val Acc=0.8112\n",
      "\n",
      "[Fold Best] Top5 Important Features (Attention Weight):\n",
      "  1. Base-Log P: 0.7129\n",
      "  2. Activate Ester_Min ElPot (kJ/mol): 0.6916\n",
      "  3. Activate Ester_Min LocIonPot (kJ/mol): 0.6687\n",
      "  4. Activate Ester_Mulliken(Hx): 0.6658\n",
      "  5. Solvent_Boiling point (°C): 0.6614\n",
      "[Fold 1] Final Acc=0.8112, F1=0.8068\n",
      "\n",
      "==================== Fold 2 ====================\n",
      "[Epoch 001] train_loss=0.6639  val_acc=0.5590  val_f1=0.4008 (best acc 0.5590)\n",
      "[Epoch 025] train_loss=0.1910  val_acc=0.7692  val_f1=0.7679 (best acc 0.7846)\n",
      "[Epoch 050] train_loss=0.0987  val_acc=0.7744  val_f1=0.7737 (best acc 0.8051)\n",
      "Early stop at epoch 64, best val Acc=0.8051\n",
      "\n",
      "[Fold Best] Top5 Important Features (Attention Weight):\n",
      "  1. Activate Ester_Dipole (debye): 0.6724\n",
      "  2. Activate Ester_Max ElPot (kJ/mol): 0.6681\n",
      "  3. Activate Ester_ExposedArea(Cy) (Å²): 0.6522\n",
      "  4. Activate Ester_Acc. Area (Å²): 0.6377\n",
      "  5. Solvent_Melting point (°C): 0.6331\n",
      "[Fold 2] Final Acc=0.8051, F1=0.8034\n",
      "\n",
      "==================== Fold 3 ====================\n",
      "[Epoch 001] train_loss=0.6820  val_acc=0.6564  val_f1=0.5587 (best acc 0.6564)\n",
      "[Epoch 025] train_loss=0.2172  val_acc=0.8308  val_f1=0.8265 (best acc 0.8513)\n",
      "Early stop at epoch 39, best val Acc=0.8513\n",
      "\n",
      "[Fold Best] Top5 Important Features (Attention Weight):\n",
      "  1. Solvent_Dielectric constant: 0.7414\n",
      "  2. Base-Dipole (debye): 0.6968\n",
      "  3. Base-pKa: 0.6762\n",
      "  4. Activate Ester_Length(Bondx) Å: 0.6557\n",
      "  5. Activate Ester_ExposedArea(Oy) (Å²): 0.6427\n",
      "[Fold 3] Final Acc=0.8513, F1=0.8482\n",
      "\n",
      "==================== Fold 4 ====================\n",
      "[Epoch 001] train_loss=0.6755  val_acc=0.6462  val_f1=0.5174 (best acc 0.6462)\n",
      "[Epoch 025] train_loss=0.1914  val_acc=0.8051  val_f1=0.8051 (best acc 0.8308)\n",
      "Early stop at epoch 41, best val Acc=0.8308\n",
      "\n",
      "[Fold Best] Top5 Important Features (Attention Weight):\n",
      "  1. Activate Ester_ExposedArea(Cy) (Å²): 0.6788\n",
      "  2. Activate Ester_ExposedArea(Hx) (Å²): 0.6514\n",
      "  3. Base-Dipole (debye): 0.6416\n",
      "  4. Activate Ester_Log P: 0.6364\n",
      "  5. Activate Ester_Electrostatic(Oy): 0.6302\n",
      "[Fold 4] Final Acc=0.8308, F1=0.8280\n",
      "\n",
      "==================== Fold 5 ====================\n",
      "[Epoch 001] train_loss=0.6632  val_acc=0.6410  val_f1=0.5008 (best acc 0.6410)\n",
      "[Epoch 025] train_loss=0.2107  val_acc=0.8051  val_f1=0.8014 (best acc 0.8205)\n",
      "Early stop at epoch 35, best val Acc=0.8205\n",
      "\n",
      "[Fold Best] Top5 Important Features (Attention Weight):\n",
      "  1. Base-pKa: 0.7356\n",
      "  2. Activate Ester_ChemShift(Cx): 0.6487\n",
      "  3. Activate Ester_ExposedArea(Cx) (Å²): 0.6428\n",
      "  4. Activate Ester_ExposedArea(Cy) (Å²): 0.6351\n",
      "  5. Activate Ester_Log P: 0.6349\n",
      "[Fold 5] Final Acc=0.8205, F1=0.8158\n",
      "\n",
      "==================== CV Summary ====================\n",
      "Accuracy: 0.8238 ± 0.0163\n",
      "Weighted F1: 0.8204 ± 0.0163\n",
      "\n",
      "==================== Final Top5 Important Features (Across All Folds) ====================\n",
      "  1. Activate Ester_ExposedArea(Cy) (Å²): Appeared in 3/5 folds\n",
      "  2. Base-Dipole (debye): Appeared in 2/5 folds\n",
      "  3. Base-pKa: Appeared in 2/5 folds\n",
      "  4. Activate Ester_Log P: Appeared in 2/5 folds\n",
      "  5. Base-Log P: Appeared in 1/5 folds\n"
     ]
    }
   ],
   "source": [
    "# -------------------------- 6. 交叉验证与关键参数汇总（新增Top5特征统计）--------------------------\n",
    "def evaluate_classification_metrics(y_true, y_pred):\n",
    "    \"\"\"分类任务评估指标（替换原回归指标）\"\"\"\n",
    "    acc = accuracy_score(y_true, y_pred)\n",
    "    f1 = f1_score(y_true, y_pred, average='weighted')\n",
    "    return acc, f1\n",
    "\n",
    "# 5折交叉验证\n",
    "kf = KFold(n_splits=5, shuffle=True, random_state=SEED)\n",
    "fold_metrics = []\n",
    "all_top5_features = []  # 存储每折的Top5特征，用于后续汇总\n",
    "\n",
    "for i, (tr_idx, val_idx) in enumerate(kf.split(X), 1):\n",
    "    print(f\"\\n==================== Fold {i} ====================\")\n",
    "    X_tr, y_tr = X[tr_idx], y[tr_idx]\n",
    "    X_val, y_val = X[val_idx], y[val_idx]\n",
    "    \n",
    "    # 训练当前折，获取最佳模型和Top5特征\n",
    "    model, scaler, best_acc, top5_feat, top5_w = train_one_fold(\n",
    "        X_tr, y_tr, X_val, y_val,\n",
    "        feature_names=feature_cols,  # 传入特征名称，用于输出\n",
    "        num_classes=num_classes,\n",
    "        epochs=300, batch_size=32, lr=1e-3, patience=30\n",
    "    )\n",
    "    \n",
    "    # 验证集最终评估\n",
    "    X_val_s = scaler.transform(X_val)\n",
    "    with torch.no_grad():\n",
    "        model.eval()\n",
    "        logits, _ = model(torch.from_numpy(X_val_s).to(DEVICE))\n",
    "        y_pred = torch.argmax(logits, dim=1).cpu().numpy()\n",
    "    \n",
    "    # 记录当前折指标\n",
    "    acc, f1 = evaluate_classification_metrics(y_val, y_pred)\n",
    "    fold_metrics.append((acc, f1))\n",
    "    all_top5_features.extend(top5_feat)  # 收集每折的Top5特征\n",
    "    print(f\"[Fold {i}] Final Acc={acc:.4f}, F1={f1:.4f}\")\n",
    "\n",
    "# -------------------------- 7. 交叉验证结果汇总 + Top5关键参数统计 --------------------------\n",
    "# 1. 交叉验证指标汇总\n",
    "print(\"\\n==================== CV Summary ====================\")\n",
    "acc_list = [m[0] for m in fold_metrics]\n",
    "f1_list = [m[1] for m in fold_metrics]\n",
    "print(f\"Accuracy: {np.mean(acc_list):.4f} ± {np.std(acc_list):.4f}\")\n",
    "print(f\"Weighted F1: {np.mean(f1_list):.4f} ± {np.std(f1_list):.4f}\")\n",
    "\n",
    "# 2. 统计所有折中【出现频率最高的Top5特征】（避免单折随机性）\n",
    "from collections import Counter\n",
    "feat_count = Counter(all_top5_features)  # 统计每个特征在各折Top5中的出现次数\n",
    "final_top5 = feat_count.most_common(5)  # 取出现次数最多的5个特征\n",
    "\n",
    "print(\"\\n==================== Final Top5 Important Features (Across All Folds) ====================\")\n",
    "for i, (feat, count) in enumerate(final_top5, 1):\n",
    "    print(f\"  {i}. {feat}: Appeared in {count}/5 folds\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "id": "3ccd09b7",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      "==================== Fold 1 ====================\n",
      "[Epoch 001] train_loss=0.6664  val_acc=0.6276  val_f1=0.5391 (best acc 0.6276)\n",
      "[Epoch 025] train_loss=0.2034  val_acc=0.7857  val_f1=0.7831 (best acc 0.8010)\n",
      "[Epoch 050] train_loss=0.1110  val_acc=0.7857  val_f1=0.7803 (best acc 0.8010)\n",
      "Early stop at epoch 50, best val Acc=0.8010\n",
      "\n",
      "[Fold Best] Top5 Important Features (Attention Weight):\n",
      "  1. Base-Electrostatic(Nx): 0.7099\n",
      "  2. Activate Ester_E HOMO (eV): 0.6785\n",
      "  3. Activate Ester_Electrostatic(Cx): 0.6708\n",
      "  4. Activate Ester_Min ElPot (kJ/mol): 0.6540\n",
      "  5. Base-Mulliken(Nx): 0.6532\n",
      "\n",
      "==================== Fold 2 ====================\n",
      "[Epoch 001] train_loss=0.6656  val_acc=0.5692  val_f1=0.4398 (best acc 0.5692)\n",
      "[Epoch 025] train_loss=0.2072  val_acc=0.7846  val_f1=0.7836 (best acc 0.7846)\n",
      "[Epoch 050] train_loss=0.1066  val_acc=0.7692  val_f1=0.7679 (best acc 0.7949)\n",
      "Early stop at epoch 71, best val Acc=0.7949\n",
      "\n",
      "[Fold Best] Top5 Important Features (Attention Weight):\n",
      "  1. Base-Acc. Area (Å²): 0.7042\n",
      "  2. Base-Electrostatic(Nx): 0.6809\n",
      "  3. Activate Ester_E LUMO (eV): 0.6338\n",
      "  4. Base-Dipole (debye): 0.6330\n",
      "  5. Activate Ester_E HOMO (eV): 0.6325\n",
      "\n",
      "==================== Fold 3 ====================\n",
      "[Epoch 001] train_loss=0.6740  val_acc=0.6103  val_f1=0.4626 (best acc 0.6103)\n",
      "[Epoch 025] train_loss=0.2144  val_acc=0.8256  val_f1=0.8209 (best acc 0.8564)\n",
      "Early stop at epoch 45, best val Acc=0.8564\n",
      "\n",
      "[Fold Best] Top5 Important Features (Attention Weight):\n",
      "  1. Solvent_HBD: 0.7087\n",
      "  2. Base-Mulliken(Nx): 0.7043\n",
      "  3. Activate Ester_Log P: 0.6707\n",
      "  4. Activate Ester_Mulliken(Hx): 0.6701\n",
      "  5. Solvent_Melting point (°C): 0.6563\n",
      "\n",
      "==================== Fold 4 ====================\n",
      "[Epoch 001] train_loss=0.6754  val_acc=0.7590  val_f1=0.7425 (best acc 0.7590)\n",
      "[Epoch 025] train_loss=0.2133  val_acc=0.8308  val_f1=0.8310 (best acc 0.8308)\n",
      "[Epoch 050] train_loss=0.0910  val_acc=0.8103  val_f1=0.8105 (best acc 0.8410)\n",
      "Early stop at epoch 63, best val Acc=0.8410\n",
      "\n",
      "[Fold Best] Top5 Important Features (Attention Weight):\n",
      "  1. Solvent_Melting point (°C): 0.6879\n",
      "  2. Base-Mulliken(Nx): 0.6849\n",
      "  3. Base-Electrostatic(Nx): 0.6443\n",
      "  4. Activate Ester_Electrostatic(Oy): 0.6121\n",
      "  5. Base-pKa: 0.6054\n",
      "\n",
      "==================== Fold 5 ====================\n",
      "[Epoch 001] train_loss=0.6709  val_acc=0.7333  val_f1=0.7090 (best acc 0.7333)\n",
      "[Epoch 025] train_loss=0.1894  val_acc=0.8051  val_f1=0.8030 (best acc 0.8256)\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Early stop at epoch 47, best val Acc=0.8256\n",
      "\n",
      "[Fold Best] Top5 Important Features (Attention Weight):\n",
      "  1. Activate Ester_Electrostatic(Cx): 0.7142\n",
      "  2. Base-Log P: 0.6942\n",
      "  3. Activate Ester_Log P: 0.6902\n",
      "  4. Activate Ester_Max ElPot (kJ/mol): 0.6794\n",
      "  5. Base-Mulliken(Nx): 0.6707\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "/tmp/ipykernel_28123/1498287793.py:137: UserWarning: Glyph 20851 (\\N{CJK UNIFIED IDEOGRAPH-5173}) missing from font(s) DejaVu Sans.\n",
      "  plt.tight_layout()\n",
      "/tmp/ipykernel_28123/1498287793.py:137: UserWarning: Glyph 38190 (\\N{CJK UNIFIED IDEOGRAPH-952E}) missing from font(s) DejaVu Sans.\n",
      "  plt.tight_layout()\n",
      "/tmp/ipykernel_28123/1498287793.py:137: UserWarning: Glyph 29305 (\\N{CJK UNIFIED IDEOGRAPH-7279}) missing from font(s) DejaVu Sans.\n",
      "  plt.tight_layout()\n",
      "/tmp/ipykernel_28123/1498287793.py:137: UserWarning: Glyph 24449 (\\N{CJK UNIFIED IDEOGRAPH-5F81}) missing from font(s) DejaVu Sans.\n",
      "  plt.tight_layout()\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "/tmp/ipykernel_28123/1498287793.py:137: UserWarning: Glyph 20986 (\\N{CJK UNIFIED IDEOGRAPH-51FA}) missing from font(s) DejaVu Sans.\n",
      "  plt.tight_layout()\n",
      "/tmp/ipykernel_28123/1498287793.py:137: UserWarning: Glyph 29616 (\\N{CJK UNIFIED IDEOGRAPH-73B0}) missing from font(s) DejaVu Sans.\n",
      "  plt.tight_layout()\n",
      "/tmp/ipykernel_28123/1498287793.py:137: UserWarning: Glyph 27425 (\\N{CJK UNIFIED IDEOGRAPH-6B21}) missing from font(s) DejaVu Sans.\n",
      "  plt.tight_layout()\n",
      "/tmp/ipykernel_28123/1498287793.py:137: UserWarning: Glyph 25968 (\\N{CJK UNIFIED IDEOGRAPH-6570}) missing from font(s) DejaVu Sans.\n",
      "  plt.tight_layout()\n",
      "/tmp/ipykernel_28123/1498287793.py:137: UserWarning: Glyph 65288 (\\N{FULLWIDTH LEFT PARENTHESIS}) missing from font(s) DejaVu Sans.\n",
      "  plt.tight_layout()\n",
      "/tmp/ipykernel_28123/1498287793.py:137: UserWarning: Glyph 39057 (\\N{CJK UNIFIED IDEOGRAPH-9891}) missing from font(s) DejaVu Sans.\n",
      "  plt.tight_layout()\n",
      "/tmp/ipykernel_28123/1498287793.py:137: UserWarning: Glyph 29575 (\\N{CJK UNIFIED IDEOGRAPH-7387}) missing from font(s) DejaVu Sans.\n",
      "  plt.tight_layout()\n",
      "/tmp/ipykernel_28123/1498287793.py:137: UserWarning: Glyph 65289 (\\N{FULLWIDTH RIGHT PARENTHESIS}) missing from font(s) DejaVu Sans.\n",
      "  plt.tight_layout()\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "/tmp/ipykernel_28123/1498287793.py:137: UserWarning: Glyph 22312 (\\N{CJK UNIFIED IDEOGRAPH-5728}) missing from font(s) DejaVu Sans.\n",
      "  plt.tight_layout()\n",
      "/tmp/ipykernel_28123/1498287793.py:137: UserWarning: Glyph 25240 (\\N{CJK UNIFIED IDEOGRAPH-6298}) missing from font(s) DejaVu Sans.\n",
      "  plt.tight_layout()\n",
      "/tmp/ipykernel_28123/1498287793.py:137: UserWarning: Glyph 20013 (\\N{CJK UNIFIED IDEOGRAPH-4E2D}) missing from font(s) DejaVu Sans.\n",
      "  plt.tight_layout()\n",
      "/tmp/ipykernel_28123/1498287793.py:137: UserWarning: Glyph 36827 (\\N{CJK UNIFIED IDEOGRAPH-8FDB}) missing from font(s) DejaVu Sans.\n",
      "  plt.tight_layout()\n",
      "/tmp/ipykernel_28123/1498287793.py:137: UserWarning: Glyph 20837 (\\N{CJK UNIFIED IDEOGRAPH-5165}) missing from font(s) DejaVu Sans.\n",
      "  plt.tight_layout()\n",
      "/tmp/ipykernel_28123/1498287793.py:137: UserWarning: Glyph 30340 (\\N{CJK UNIFIED IDEOGRAPH-7684}) missing from font(s) DejaVu Sans.\n",
      "  plt.tight_layout()\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "/tmp/ipykernel_28123/1498287793.py:137: UserWarning: Glyph 24179 (\\N{CJK UNIFIED IDEOGRAPH-5E73}) missing from font(s) DejaVu Sans.\n",
      "  plt.tight_layout()\n",
      "/tmp/ipykernel_28123/1498287793.py:137: UserWarning: Glyph 22343 (\\N{CJK UNIFIED IDEOGRAPH-5747}) missing from font(s) DejaVu Sans.\n",
      "  plt.tight_layout()\n",
      "/tmp/ipykernel_28123/1498287793.py:137: UserWarning: Glyph 27880 (\\N{CJK UNIFIED IDEOGRAPH-6CE8}) missing from font(s) DejaVu Sans.\n",
      "  plt.tight_layout()\n",
      "/tmp/ipykernel_28123/1498287793.py:137: UserWarning: Glyph 24847 (\\N{CJK UNIFIED IDEOGRAPH-610F}) missing from font(s) DejaVu Sans.\n",
      "  plt.tight_layout()\n",
      "/tmp/ipykernel_28123/1498287793.py:137: UserWarning: Glyph 21147 (\\N{CJK UNIFIED IDEOGRAPH-529B}) missing from font(s) DejaVu Sans.\n",
      "  plt.tight_layout()\n",
      "/tmp/ipykernel_28123/1498287793.py:137: UserWarning: Glyph 26435 (\\N{CJK UNIFIED IDEOGRAPH-6743}) missing from font(s) DejaVu Sans.\n",
      "  plt.tight_layout()\n",
      "/tmp/ipykernel_28123/1498287793.py:137: UserWarning: Glyph 37325 (\\N{CJK UNIFIED IDEOGRAPH-91CD}) missing from font(s) DejaVu Sans.\n",
      "  plt.tight_layout()\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "/tmp/ipykernel_28123/1498287793.py:137: UserWarning: Glyph 20998 (\\N{CJK UNIFIED IDEOGRAPH-5206}) missing from font(s) DejaVu Sans.\n",
      "  plt.tight_layout()\n",
      "/tmp/ipykernel_28123/1498287793.py:137: UserWarning: Glyph 31867 (\\N{CJK UNIFIED IDEOGRAPH-7C7B}) missing from font(s) DejaVu Sans.\n",
      "  plt.tight_layout()\n",
      "/tmp/ipykernel_28123/1498287793.py:137: UserWarning: Glyph 27169 (\\N{CJK UNIFIED IDEOGRAPH-6A21}) missing from font(s) DejaVu Sans.\n",
      "  plt.tight_layout()\n",
      "/tmp/ipykernel_28123/1498287793.py:137: UserWarning: Glyph 22411 (\\N{CJK UNIFIED IDEOGRAPH-578B}) missing from font(s) DejaVu Sans.\n",
      "  plt.tight_layout()\n",
      "/tmp/ipykernel_28123/1498287793.py:137: UserWarning: Glyph 65306 (\\N{FULLWIDTH COLON}) missing from font(s) DejaVu Sans.\n",
      "  plt.tight_layout()\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "/tmp/ipykernel_28123/1498287793.py:140: UserWarning: Glyph 20851 (\\N{CJK UNIFIED IDEOGRAPH-5173}) missing from font(s) DejaVu Sans.\n",
      "  plt.savefig('top5_features_analysis.png', dpi=300, bbox_inches='tight')\n",
      "/tmp/ipykernel_28123/1498287793.py:140: UserWarning: Glyph 38190 (\\N{CJK UNIFIED IDEOGRAPH-952E}) missing from font(s) DejaVu Sans.\n",
      "  plt.savefig('top5_features_analysis.png', dpi=300, bbox_inches='tight')\n",
      "/tmp/ipykernel_28123/1498287793.py:140: UserWarning: Glyph 29305 (\\N{CJK UNIFIED IDEOGRAPH-7279}) missing from font(s) DejaVu Sans.\n",
      "  plt.savefig('top5_features_analysis.png', dpi=300, bbox_inches='tight')\n",
      "/tmp/ipykernel_28123/1498287793.py:140: UserWarning: Glyph 24449 (\\N{CJK UNIFIED IDEOGRAPH-5F81}) missing from font(s) DejaVu Sans.\n",
      "  plt.savefig('top5_features_analysis.png', dpi=300, bbox_inches='tight')\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "/tmp/ipykernel_28123/1498287793.py:140: UserWarning: Glyph 20986 (\\N{CJK UNIFIED IDEOGRAPH-51FA}) missing from font(s) DejaVu Sans.\n",
      "  plt.savefig('top5_features_analysis.png', dpi=300, bbox_inches='tight')\n",
      "/tmp/ipykernel_28123/1498287793.py:140: UserWarning: Glyph 29616 (\\N{CJK UNIFIED IDEOGRAPH-73B0}) missing from font(s) DejaVu Sans.\n",
      "  plt.savefig('top5_features_analysis.png', dpi=300, bbox_inches='tight')\n",
      "/tmp/ipykernel_28123/1498287793.py:140: UserWarning: Glyph 27425 (\\N{CJK UNIFIED IDEOGRAPH-6B21}) missing from font(s) DejaVu Sans.\n",
      "  plt.savefig('top5_features_analysis.png', dpi=300, bbox_inches='tight')\n",
      "/tmp/ipykernel_28123/1498287793.py:140: UserWarning: Glyph 25968 (\\N{CJK UNIFIED IDEOGRAPH-6570}) missing from font(s) DejaVu Sans.\n",
      "  plt.savefig('top5_features_analysis.png', dpi=300, bbox_inches='tight')\n",
      "/tmp/ipykernel_28123/1498287793.py:140: UserWarning: Glyph 65288 (\\N{FULLWIDTH LEFT PARENTHESIS}) missing from font(s) DejaVu Sans.\n",
      "  plt.savefig('top5_features_analysis.png', dpi=300, bbox_inches='tight')\n",
      "/tmp/ipykernel_28123/1498287793.py:140: UserWarning: Glyph 39057 (\\N{CJK UNIFIED IDEOGRAPH-9891}) missing from font(s) DejaVu Sans.\n",
      "  plt.savefig('top5_features_analysis.png', dpi=300, bbox_inches='tight')\n",
      "/tmp/ipykernel_28123/1498287793.py:140: UserWarning: Glyph 29575 (\\N{CJK UNIFIED IDEOGRAPH-7387}) missing from font(s) DejaVu Sans.\n",
      "  plt.savefig('top5_features_analysis.png', dpi=300, bbox_inches='tight')\n",
      "/tmp/ipykernel_28123/1498287793.py:140: UserWarning: Glyph 65289 (\\N{FULLWIDTH RIGHT PARENTHESIS}) missing from font(s) DejaVu Sans.\n",
      "  plt.savefig('top5_features_analysis.png', dpi=300, bbox_inches='tight')\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "/tmp/ipykernel_28123/1498287793.py:140: UserWarning: Glyph 22312 (\\N{CJK UNIFIED IDEOGRAPH-5728}) missing from font(s) DejaVu Sans.\n",
      "  plt.savefig('top5_features_analysis.png', dpi=300, bbox_inches='tight')\n",
      "/tmp/ipykernel_28123/1498287793.py:140: UserWarning: Glyph 25240 (\\N{CJK UNIFIED IDEOGRAPH-6298}) missing from font(s) DejaVu Sans.\n",
      "  plt.savefig('top5_features_analysis.png', dpi=300, bbox_inches='tight')\n",
      "/tmp/ipykernel_28123/1498287793.py:140: UserWarning: Glyph 20013 (\\N{CJK UNIFIED IDEOGRAPH-4E2D}) missing from font(s) DejaVu Sans.\n",
      "  plt.savefig('top5_features_analysis.png', dpi=300, bbox_inches='tight')\n",
      "/tmp/ipykernel_28123/1498287793.py:140: UserWarning: Glyph 36827 (\\N{CJK UNIFIED IDEOGRAPH-8FDB}) missing from font(s) DejaVu Sans.\n",
      "  plt.savefig('top5_features_analysis.png', dpi=300, bbox_inches='tight')\n",
      "/tmp/ipykernel_28123/1498287793.py:140: UserWarning: Glyph 20837 (\\N{CJK UNIFIED IDEOGRAPH-5165}) missing from font(s) DejaVu Sans.\n",
      "  plt.savefig('top5_features_analysis.png', dpi=300, bbox_inches='tight')\n",
      "/tmp/ipykernel_28123/1498287793.py:140: UserWarning: Glyph 30340 (\\N{CJK UNIFIED IDEOGRAPH-7684}) missing from font(s) DejaVu Sans.\n",
      "  plt.savefig('top5_features_analysis.png', dpi=300, bbox_inches='tight')\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "/tmp/ipykernel_28123/1498287793.py:140: UserWarning: Glyph 24179 (\\N{CJK UNIFIED IDEOGRAPH-5E73}) missing from font(s) DejaVu Sans.\n",
      "  plt.savefig('top5_features_analysis.png', dpi=300, bbox_inches='tight')\n",
      "/tmp/ipykernel_28123/1498287793.py:140: UserWarning: Glyph 22343 (\\N{CJK UNIFIED IDEOGRAPH-5747}) missing from font(s) DejaVu Sans.\n",
      "  plt.savefig('top5_features_analysis.png', dpi=300, bbox_inches='tight')\n",
      "/tmp/ipykernel_28123/1498287793.py:140: UserWarning: Glyph 27880 (\\N{CJK UNIFIED IDEOGRAPH-6CE8}) missing from font(s) DejaVu Sans.\n",
      "  plt.savefig('top5_features_analysis.png', dpi=300, bbox_inches='tight')\n",
      "/tmp/ipykernel_28123/1498287793.py:140: UserWarning: Glyph 24847 (\\N{CJK UNIFIED IDEOGRAPH-610F}) missing from font(s) DejaVu Sans.\n",
      "  plt.savefig('top5_features_analysis.png', dpi=300, bbox_inches='tight')\n",
      "/tmp/ipykernel_28123/1498287793.py:140: UserWarning: Glyph 21147 (\\N{CJK UNIFIED IDEOGRAPH-529B}) missing from font(s) DejaVu Sans.\n",
      "  plt.savefig('top5_features_analysis.png', dpi=300, bbox_inches='tight')\n",
      "/tmp/ipykernel_28123/1498287793.py:140: UserWarning: Glyph 26435 (\\N{CJK UNIFIED IDEOGRAPH-6743}) missing from font(s) DejaVu Sans.\n",
      "  plt.savefig('top5_features_analysis.png', dpi=300, bbox_inches='tight')\n",
      "/tmp/ipykernel_28123/1498287793.py:140: UserWarning: Glyph 37325 (\\N{CJK UNIFIED IDEOGRAPH-91CD}) missing from font(s) DejaVu Sans.\n",
      "  plt.savefig('top5_features_analysis.png', dpi=300, bbox_inches='tight')\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "/tmp/ipykernel_28123/1498287793.py:140: UserWarning: Glyph 20998 (\\N{CJK UNIFIED IDEOGRAPH-5206}) missing from font(s) DejaVu Sans.\n",
      "  plt.savefig('top5_features_analysis.png', dpi=300, bbox_inches='tight')\n",
      "/tmp/ipykernel_28123/1498287793.py:140: UserWarning: Glyph 31867 (\\N{CJK UNIFIED IDEOGRAPH-7C7B}) missing from font(s) DejaVu Sans.\n",
      "  plt.savefig('top5_features_analysis.png', dpi=300, bbox_inches='tight')\n",
      "/tmp/ipykernel_28123/1498287793.py:140: UserWarning: Glyph 27169 (\\N{CJK UNIFIED IDEOGRAPH-6A21}) missing from font(s) DejaVu Sans.\n",
      "  plt.savefig('top5_features_analysis.png', dpi=300, bbox_inches='tight')\n",
      "/tmp/ipykernel_28123/1498287793.py:140: UserWarning: Glyph 22411 (\\N{CJK UNIFIED IDEOGRAPH-578B}) missing from font(s) DejaVu Sans.\n",
      "  plt.savefig('top5_features_analysis.png', dpi=300, bbox_inches='tight')\n",
      "/tmp/ipykernel_28123/1498287793.py:140: UserWarning: Glyph 65306 (\\N{FULLWIDTH COLON}) missing from font(s) DejaVu Sans.\n",
      "  plt.savefig('top5_features_analysis.png', dpi=300, bbox_inches='tight')\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "可视化图表已保存为：top5_features_analysis.png\n",
      "\n",
      "Top5特征详细信息：\n",
      "  1. 特征名：Base-Mulliken(Nx) | 出现次数：4/5折 | 平均注意力权重：0.678\n",
      "  2. 特征名：Base-Electrostatic(Nx) | 出现次数：3/5折 | 平均注意力权重：0.678\n",
      "  3. 特征名：Activate Ester_E HOMO (eV) | 出现次数：2/5折 | 平均注意力权重：0.656\n",
      "  4. 特征名：Activate Ester_Electrostatic(Cx) | 出现次数：2/5折 | 平均注意力权重：0.692\n",
      "  5. 特征名：Activate Ester_Log P | 出现次数：2/5折 | 平均注意力权重：0.680\n"
     ]
    }
   ],
   "source": [
    "import matplotlib.pyplot as plt\n",
    "import numpy as np\n",
    "from collections import Counter\n",
    "\n",
    "# -------------------------- 1. 准备可视化数据（衔接交叉验证结果）--------------------------\n",
    "# （若单独运行，需先确保以下变量已从分类模型代码中获取）\n",
    "# all_top5_features：所有折中出现的Top5特征列表（来自交叉验证部分）\n",
    "# 新增：收集每折的Top5特征权重，用于计算平均权重（需在交叉验证时补充记录）\n",
    "# （注：若之前未记录每折权重，需先在train_one_fold返回时添加top5_weights，再在交叉验证中收集）\n",
    "\n",
    "# 补充：假设在交叉验证循环中已添加权重收集（若未添加，需先修改交叉验证部分）\n",
    "# 此处先定义变量结构，确保可视化代码可运行\n",
    "# （实际使用时，需将交叉验证中的权重收集代码解除注释）\n",
    "fold_top5_info = []  # 存储每折的 (top5特征名, top5权重)，需在交叉验证时填充\n",
    "\n",
    "# -------------------------- 2. 重新运行交叉验证（补充权重收集，若已运行可跳过）--------------------------\n",
    "# （若之前未收集权重，需重新执行此部分交叉验证，替换原交叉验证代码）\n",
    "kf = KFold(n_splits=5, shuffle=True, random_state=SEED)\n",
    "fold_metrics = []\n",
    "all_top5_features = []\n",
    "fold_top5_info = []  # 新增：收集每折的Top5特征和权重\n",
    "\n",
    "for i, (tr_idx, val_idx) in enumerate(kf.split(X), 1):\n",
    "    print(f\"\\n==================== Fold {i} ====================\")\n",
    "    X_tr, y_tr = X[tr_idx], y[tr_idx]\n",
    "    X_val, y_val = X[val_idx], y[val_idx]\n",
    "    \n",
    "    # 训练当前折，获取Top5特征和对应的权重\n",
    "    model, scaler, best_acc, top5_feat, top5_w = train_one_fold(\n",
    "        X_tr, y_tr, X_val, y_val,\n",
    "        feature_names=feature_cols,\n",
    "        num_classes=num_classes,\n",
    "        epochs=300, batch_size=32, lr=1e-3, patience=30\n",
    "    )\n",
    "    \n",
    "    # 收集当前折的Top5信息（特征名+权重）\n",
    "    fold_top5_info.append( (top5_feat, top5_w) )\n",
    "    all_top5_features.extend(top5_feat)\n",
    "    \n",
    "    # 后续评估代码不变...\n",
    "\n",
    "# -------------------------- 3. 计算最终Top5特征的频率和平均权重--------------------------\n",
    "# 3.1 计算特征出现频率（各折中进入Top5的次数）\n",
    "feat_count = Counter(all_top5_features)\n",
    "final_top5_feats = [feat for feat, _ in feat_count.most_common(5)]  # 最终Top5特征名\n",
    "final_top5_counts = [count for _, count in feat_count.most_common(5)]  # 对应出现次数\n",
    "\n",
    "# 3.2 计算特征平均注意力权重（仅统计该特征进入Top5时的权重，取均值）\n",
    "final_top5_avg_weights = []\n",
    "for target_feat in final_top5_feats:\n",
    "    weights = []\n",
    "    # 遍历每折的Top5信息，收集目标特征的权重\n",
    "    for fold_feats, fold_weights in fold_top5_info:\n",
    "        if target_feat in fold_feats:\n",
    "            # 找到该特征在当前折的权重\n",
    "            feat_idx_in_fold = fold_feats.index(target_feat)\n",
    "            weights.append(fold_weights[feat_idx_in_fold])\n",
    "    # 计算该特征的平均权重\n",
    "    avg_w = np.mean(weights) if weights else 0.0\n",
    "    final_top5_avg_weights.append(avg_w)\n",
    "\n",
    "# -------------------------- 4. 生成组合柱状图--------------------------\n",
    "# 设置中文字体（避免中文乱码）\n",
    "plt.rcParams['font.sans-serif'] = ['WenQuanYi Zen Hei', 'SimHei', 'Arial Unicode MS']\n",
    "plt.rcParams['axes.unicode_minus'] = False\n",
    "\n",
    "# 创建画布和轴（双y轴，分别对应频率和权重）\n",
    "fig, ax1 = plt.subplots(figsize=(10, 6))\n",
    "\n",
    "# 定义x轴位置（Top5特征）\n",
    "x = np.arange(len(final_top5_feats))\n",
    "width = 0.35  # 柱子宽度\n",
    "\n",
    "# 绘制第一个y轴：特征出现频率（蓝色）\n",
    "bars1 = ax1.bar(\n",
    "    x - width/2,  # 左移半个宽度，避免重叠\n",
    "    final_top5_counts,\n",
    "    width,\n",
    "    label='在5折中进入Top5的次数',\n",
    "    color='#3498db',  # 蓝色\n",
    "    alpha=0.8\n",
    ")\n",
    "ax1.set_xlabel('Top5关键特征', fontsize=12, fontweight='bold')\n",
    "ax1.set_ylabel('出现次数（频率）', fontsize=12, fontweight='bold', color='#3498db')\n",
    "ax1.tick_params(axis='y', labelcolor='#3498db')\n",
    "ax1.set_ylim(0, max(final_top5_counts) + 1)  # 频率轴范围：0到最大次数+1\n",
    "\n",
    "# 创建第二个y轴：平均注意力权重（橙色）\n",
    "ax2 = ax1.twinx()\n",
    "bars2 = ax2.bar(\n",
    "    x + width/2,  # 右移半个宽度，避免重叠\n",
    "    final_top5_avg_weights,\n",
    "    width,\n",
    "    label='平均注意力权重',\n",
    "    color='#e74c3c',  # 橙色\n",
    "    alpha=0.8\n",
    ")\n",
    "ax2.set_ylabel('平均注意力权重', fontsize=12, fontweight='bold', color='#e74c3c')\n",
    "ax2.tick_params(axis='y', labelcolor='#e74c3c')\n",
    "ax2.set_ylim(0, max(final_top5_avg_weights) * 1.2)  # 权重轴范围：0到最大权重*1.2，留有余地\n",
    "\n",
    "# 设置x轴标签（特征名，旋转45度避免重叠）\n",
    "ax1.set_xticks(x)\n",
    "ax1.set_xticklabels(final_top5_feats, rotation=45, ha='right', fontsize=10)\n",
    "\n",
    "# 添加数值标签（在每个柱子顶部显示具体数值）\n",
    "# 频率柱子的数值标签\n",
    "for bar in bars1:\n",
    "    height = bar.get_height()\n",
    "    ax1.text(\n",
    "        bar.get_x() + bar.get_width()/2.,\n",
    "        height + 0.1,  # 数值在柱子顶部上方0.1处\n",
    "        f'{int(height)}',\n",
    "        ha='center', va='bottom', fontsize=9, fontweight='bold', color='#3498db'\n",
    "    )\n",
    "# 权重柱子的数值标签\n",
    "for bar in bars2:\n",
    "    height = bar.get_height()\n",
    "    ax2.text(\n",
    "        bar.get_x() + bar.get_width()/2.,\n",
    "        height + 0.01,  # 数值在柱子顶部上方0.01处（权重值较小，间距缩小）\n",
    "        f'{height:.3f}',\n",
    "        ha='center', va='bottom', fontsize=9, fontweight='bold', color='#e74c3c'\n",
    "    )\n",
    "\n",
    "# 添加标题和图例\n",
    "plt.title(\n",
    "    '分类模型Top5关键特征：出现频率 vs 平均注意力权重',\n",
    "    fontsize=14, fontweight='bold', pad=20\n",
    ")\n",
    "# 合并两个轴的图例\n",
    "lines1, labels1 = ax1.get_legend_handles_labels()\n",
    "lines2, labels2 = ax2.get_legend_handles_labels()\n",
    "ax1.legend(lines1 + lines2, labels1 + labels2, loc='upper right', fontsize=10)\n",
    "\n",
    "# 调整布局（避免标签被截断）\n",
    "plt.tight_layout()\n",
    "\n",
    "# 保存图片（可修改路径和格式，支持png/jpg/pdf）\n",
    "plt.savefig('top5_features_analysis.png', dpi=300, bbox_inches='tight')\n",
    "plt.close()\n",
    "\n",
    "print(\"可视化图表已保存为：top5_features_analysis.png\")\n",
    "print(\"\\nTop5特征详细信息：\")\n",
    "for i, (feat, count, avg_w) in enumerate(zip(final_top5_feats, final_top5_counts, final_top5_avg_weights), 1):\n",
    "    print(f\"  {i}. 特征名：{feat} | 出现次数：{count}/5折 | 平均注意力权重：{avg_w:.3f}\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "id": "39758f01",
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "所有特征平均注意力权重（前10名）：\n",
      "                          feature_name  avg_attn_weight\n",
      "0     Activate Ester_Electrostatic(Cx)         0.718259\n",
      "1                           Base-Log P         0.705098\n",
      "2                 Activate Ester_Log P         0.688363\n",
      "3                  Base-Dipole (debye)         0.672873\n",
      "4    Activate Ester_Max ElPot (kJ/mol)         0.668766\n",
      "5  Activate Ester_ExposedArea(Hx) (Å²)         0.662562\n",
      "6                    Base-Mulliken(Nx)         0.657415\n",
      "7          Solvent_Dielectric constant         0.655484\n",
      "8               Solvent_Viscosity (cP)         0.641612\n",
      "9                             Base-pKa         0.634319\n",
      "\n",
      "所有特征平均注意力权重（后10名）：\n",
      "                           feature_name  avg_attn_weight\n",
      "37        Activate Ester_Polarizability         0.427804\n",
      "38         Activate Ester_ChemShift(Cx)         0.425734\n",
      "39   Activate Ester_Polar Area(75) (Å²)         0.425416\n",
      "40                          Solvent_HBD         0.417424\n",
      "41  Activate Ester_ExposedArea(Oy) (Å²)         0.416288\n",
      "42          Activate Ester_Mulliken(Cx)         0.394868\n",
      "43     Activate Ester_Electrostatic(Oy)         0.394120\n",
      "44         Activate Ester_ChemShift(Oy)         0.375725\n",
      "45           Activate Ester_Natural(Cx)         0.366665\n",
      "46       Activate Ester_Length(Bondx) Å         0.356946\n",
      "\n",
      "总计特征数：47\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/tmp/ipykernel_28123/63877249.py:123: UserWarning: Glyph 24179 (\\N{CJK UNIFIED IDEOGRAPH-5E73}) missing from font(s) DejaVu Sans.\n",
      "  plt.tight_layout()\n",
      "/tmp/ipykernel_28123/63877249.py:123: UserWarning: Glyph 22343 (\\N{CJK UNIFIED IDEOGRAPH-5747}) missing from font(s) DejaVu Sans.\n",
      "  plt.tight_layout()\n",
      "/tmp/ipykernel_28123/63877249.py:123: UserWarning: Glyph 27880 (\\N{CJK UNIFIED IDEOGRAPH-6CE8}) missing from font(s) DejaVu Sans.\n",
      "  plt.tight_layout()\n",
      "/tmp/ipykernel_28123/63877249.py:123: UserWarning: Glyph 24847 (\\N{CJK UNIFIED IDEOGRAPH-610F}) missing from font(s) DejaVu Sans.\n",
      "  plt.tight_layout()\n",
      "/tmp/ipykernel_28123/63877249.py:123: UserWarning: Glyph 21147 (\\N{CJK UNIFIED IDEOGRAPH-529B}) missing from font(s) DejaVu Sans.\n",
      "  plt.tight_layout()\n",
      "/tmp/ipykernel_28123/63877249.py:123: UserWarning: Glyph 26435 (\\N{CJK UNIFIED IDEOGRAPH-6743}) missing from font(s) DejaVu Sans.\n",
      "  plt.tight_layout()\n",
      "/tmp/ipykernel_28123/63877249.py:123: UserWarning: Glyph 37325 (\\N{CJK UNIFIED IDEOGRAPH-91CD}) missing from font(s) DejaVu Sans.\n",
      "  plt.tight_layout()\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "/tmp/ipykernel_28123/63877249.py:123: UserWarning: Glyph 29305 (\\N{CJK UNIFIED IDEOGRAPH-7279}) missing from font(s) DejaVu Sans.\n",
      "  plt.tight_layout()\n",
      "/tmp/ipykernel_28123/63877249.py:123: UserWarning: Glyph 24449 (\\N{CJK UNIFIED IDEOGRAPH-5F81}) missing from font(s) DejaVu Sans.\n",
      "  plt.tight_layout()\n",
      "/tmp/ipykernel_28123/63877249.py:123: UserWarning: Glyph 21517 (\\N{CJK UNIFIED IDEOGRAPH-540D}) missing from font(s) DejaVu Sans.\n",
      "  plt.tight_layout()\n",
      "/tmp/ipykernel_28123/63877249.py:123: UserWarning: Glyph 31216 (\\N{CJK UNIFIED IDEOGRAPH-79F0}) missing from font(s) DejaVu Sans.\n",
      "  plt.tight_layout()\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "/tmp/ipykernel_28123/63877249.py:123: UserWarning: Glyph 25152 (\\N{CJK UNIFIED IDEOGRAPH-6240}) missing from font(s) DejaVu Sans.\n",
      "  plt.tight_layout()\n",
      "/tmp/ipykernel_28123/63877249.py:123: UserWarning: Glyph 26377 (\\N{CJK UNIFIED IDEOGRAPH-6709}) missing from font(s) DejaVu Sans.\n",
      "  plt.tight_layout()\n",
      "/tmp/ipykernel_28123/63877249.py:123: UserWarning: Glyph 21442 (\\N{CJK UNIFIED IDEOGRAPH-53C2}) missing from font(s) DejaVu Sans.\n",
      "  plt.tight_layout()\n",
      "/tmp/ipykernel_28123/63877249.py:123: UserWarning: Glyph 25968 (\\N{CJK UNIFIED IDEOGRAPH-6570}) missing from font(s) DejaVu Sans.\n",
      "  plt.tight_layout()\n",
      "/tmp/ipykernel_28123/63877249.py:123: UserWarning: Glyph 30340 (\\N{CJK UNIFIED IDEOGRAPH-7684}) missing from font(s) DejaVu Sans.\n",
      "  plt.tight_layout()\n",
      "/tmp/ipykernel_28123/63877249.py:123: UserWarning: Glyph 65288 (\\N{FULLWIDTH LEFT PARENTHESIS}) missing from font(s) DejaVu Sans.\n",
      "  plt.tight_layout()\n",
      "/tmp/ipykernel_28123/63877249.py:123: UserWarning: Glyph 24635 (\\N{CJK UNIFIED IDEOGRAPH-603B}) missing from font(s) DejaVu Sans.\n",
      "  plt.tight_layout()\n",
      "/tmp/ipykernel_28123/63877249.py:123: UserWarning: Glyph 35745 (\\N{CJK UNIFIED IDEOGRAPH-8BA1}) missing from font(s) DejaVu Sans.\n",
      "  plt.tight_layout()\n",
      "/tmp/ipykernel_28123/63877249.py:123: UserWarning: Glyph 20010 (\\N{CJK UNIFIED IDEOGRAPH-4E2A}) missing from font(s) DejaVu Sans.\n",
      "  plt.tight_layout()\n",
      "/tmp/ipykernel_28123/63877249.py:123: UserWarning: Glyph 65289 (\\N{FULLWIDTH RIGHT PARENTHESIS}) missing from font(s) DejaVu Sans.\n",
      "  plt.tight_layout()\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "/tmp/ipykernel_28123/63877249.py:126: UserWarning: Glyph 29305 (\\N{CJK UNIFIED IDEOGRAPH-7279}) missing from font(s) DejaVu Sans.\n",
      "  plt.savefig('all_features_avg_attn_weights.png', dpi=300, bbox_inches='tight')\n",
      "/tmp/ipykernel_28123/63877249.py:126: UserWarning: Glyph 24449 (\\N{CJK UNIFIED IDEOGRAPH-5F81}) missing from font(s) DejaVu Sans.\n",
      "  plt.savefig('all_features_avg_attn_weights.png', dpi=300, bbox_inches='tight')\n",
      "/tmp/ipykernel_28123/63877249.py:126: UserWarning: Glyph 21517 (\\N{CJK UNIFIED IDEOGRAPH-540D}) missing from font(s) DejaVu Sans.\n",
      "  plt.savefig('all_features_avg_attn_weights.png', dpi=300, bbox_inches='tight')\n",
      "/tmp/ipykernel_28123/63877249.py:126: UserWarning: Glyph 31216 (\\N{CJK UNIFIED IDEOGRAPH-79F0}) missing from font(s) DejaVu Sans.\n",
      "  plt.savefig('all_features_avg_attn_weights.png', dpi=300, bbox_inches='tight')\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "/tmp/ipykernel_28123/63877249.py:126: UserWarning: Glyph 25152 (\\N{CJK UNIFIED IDEOGRAPH-6240}) missing from font(s) DejaVu Sans.\n",
      "  plt.savefig('all_features_avg_attn_weights.png', dpi=300, bbox_inches='tight')\n",
      "/tmp/ipykernel_28123/63877249.py:126: UserWarning: Glyph 26377 (\\N{CJK UNIFIED IDEOGRAPH-6709}) missing from font(s) DejaVu Sans.\n",
      "  plt.savefig('all_features_avg_attn_weights.png', dpi=300, bbox_inches='tight')\n",
      "/tmp/ipykernel_28123/63877249.py:126: UserWarning: Glyph 21442 (\\N{CJK UNIFIED IDEOGRAPH-53C2}) missing from font(s) DejaVu Sans.\n",
      "  plt.savefig('all_features_avg_attn_weights.png', dpi=300, bbox_inches='tight')\n",
      "/tmp/ipykernel_28123/63877249.py:126: UserWarning: Glyph 25968 (\\N{CJK UNIFIED IDEOGRAPH-6570}) missing from font(s) DejaVu Sans.\n",
      "  plt.savefig('all_features_avg_attn_weights.png', dpi=300, bbox_inches='tight')\n",
      "/tmp/ipykernel_28123/63877249.py:126: UserWarning: Glyph 30340 (\\N{CJK UNIFIED IDEOGRAPH-7684}) missing from font(s) DejaVu Sans.\n",
      "  plt.savefig('all_features_avg_attn_weights.png', dpi=300, bbox_inches='tight')\n",
      "/tmp/ipykernel_28123/63877249.py:126: UserWarning: Glyph 24179 (\\N{CJK UNIFIED IDEOGRAPH-5E73}) missing from font(s) DejaVu Sans.\n",
      "  plt.savefig('all_features_avg_attn_weights.png', dpi=300, bbox_inches='tight')\n",
      "/tmp/ipykernel_28123/63877249.py:126: UserWarning: Glyph 22343 (\\N{CJK UNIFIED IDEOGRAPH-5747}) missing from font(s) DejaVu Sans.\n",
      "  plt.savefig('all_features_avg_attn_weights.png', dpi=300, bbox_inches='tight')\n",
      "/tmp/ipykernel_28123/63877249.py:126: UserWarning: Glyph 27880 (\\N{CJK UNIFIED IDEOGRAPH-6CE8}) missing from font(s) DejaVu Sans.\n",
      "  plt.savefig('all_features_avg_attn_weights.png', dpi=300, bbox_inches='tight')\n",
      "/tmp/ipykernel_28123/63877249.py:126: UserWarning: Glyph 24847 (\\N{CJK UNIFIED IDEOGRAPH-610F}) missing from font(s) DejaVu Sans.\n",
      "  plt.savefig('all_features_avg_attn_weights.png', dpi=300, bbox_inches='tight')\n",
      "/tmp/ipykernel_28123/63877249.py:126: UserWarning: Glyph 21147 (\\N{CJK UNIFIED IDEOGRAPH-529B}) missing from font(s) DejaVu Sans.\n",
      "  plt.savefig('all_features_avg_attn_weights.png', dpi=300, bbox_inches='tight')\n",
      "/tmp/ipykernel_28123/63877249.py:126: UserWarning: Glyph 26435 (\\N{CJK UNIFIED IDEOGRAPH-6743}) missing from font(s) DejaVu Sans.\n",
      "  plt.savefig('all_features_avg_attn_weights.png', dpi=300, bbox_inches='tight')\n",
      "/tmp/ipykernel_28123/63877249.py:126: UserWarning: Glyph 37325 (\\N{CJK UNIFIED IDEOGRAPH-91CD}) missing from font(s) DejaVu Sans.\n",
      "  plt.savefig('all_features_avg_attn_weights.png', dpi=300, bbox_inches='tight')\n",
      "/tmp/ipykernel_28123/63877249.py:126: UserWarning: Glyph 65288 (\\N{FULLWIDTH LEFT PARENTHESIS}) missing from font(s) DejaVu Sans.\n",
      "  plt.savefig('all_features_avg_attn_weights.png', dpi=300, bbox_inches='tight')\n",
      "/tmp/ipykernel_28123/63877249.py:126: UserWarning: Glyph 24635 (\\N{CJK UNIFIED IDEOGRAPH-603B}) missing from font(s) DejaVu Sans.\n",
      "  plt.savefig('all_features_avg_attn_weights.png', dpi=300, bbox_inches='tight')\n",
      "/tmp/ipykernel_28123/63877249.py:126: UserWarning: Glyph 35745 (\\N{CJK UNIFIED IDEOGRAPH-8BA1}) missing from font(s) DejaVu Sans.\n",
      "  plt.savefig('all_features_avg_attn_weights.png', dpi=300, bbox_inches='tight')\n",
      "/tmp/ipykernel_28123/63877249.py:126: UserWarning: Glyph 20010 (\\N{CJK UNIFIED IDEOGRAPH-4E2A}) missing from font(s) DejaVu Sans.\n",
      "  plt.savefig('all_features_avg_attn_weights.png', dpi=300, bbox_inches='tight')\n",
      "/tmp/ipykernel_28123/63877249.py:126: UserWarning: Glyph 65289 (\\N{FULLWIDTH RIGHT PARENTHESIS}) missing from font(s) DejaVu Sans.\n",
      "  plt.savefig('all_features_avg_attn_weights.png', dpi=300, bbox_inches='tight')\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n",
      "findfont: Generic family 'sans-serif' not found because none of the following families were found: WenQuanYi Zen Hei, SimHei, Arial Unicode MS\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      "所有参数注意力权重图表已保存为：all_features_avg_attn_weights.png\n",
      "所有特征权重排序表已保存为：all_features_attn_weight_ranking.xlsx\n"
     ]
    }
   ],
   "source": [
    "import matplotlib.pyplot as plt\n",
    "import numpy as np\n",
    "import pandas as pd\n",
    "\n",
    "# -------------------------- 1. 核心前提：获取所有特征的平均注意力权重 --------------------------\n",
    "# （需确保分类模型已训练完成，且有训练好的最佳模型 + 特征名称列表）\n",
    "# 关键逻辑：用全量数据（或验证集）计算每个特征在所有样本上的注意力权重均值，覆盖所有参数\n",
    "\n",
    "def get_all_features_avg_attn(model, scaler, X_all, feature_names, device, batch_size=256):\n",
    "    \"\"\"\n",
    "    计算所有特征的平均注意力权重\n",
    "    Args:\n",
    "        model: 训练好的分类模型（带FeatureAttention）\n",
    "        scaler: 数据标准化器（训练时拟合的）\n",
    "        X_all: 全量特征数据（numpy数组）\n",
    "        feature_names: 所有特征的名称列表\n",
    "        device: 计算设备（cuda/cpu）\n",
    "        batch_size: 批处理大小（避免内存溢出）\n",
    "    Returns:\n",
    "        DataFrame: 包含特征名、平均注意力权重，已按权重排序\n",
    "    \"\"\"\n",
    "    model.eval()  # 模型设为评估模式\n",
    "    all_attn_weights = []  # 存储所有样本的注意力权重\n",
    "    \n",
    "    # 批处理计算（避免全量数据一次性入内存）\n",
    "    with torch.no_grad():\n",
    "        for i in range(0, len(X_all), batch_size):\n",
    "            # 取当前批次数据并标准化\n",
    "            X_batch = X_all[i:i+batch_size]\n",
    "            X_batch_s = scaler.transform(X_batch)\n",
    "            X_batch_tensor = torch.from_numpy(X_batch_s).to(device)\n",
    "            \n",
    "            # 前向传播，仅获取注意力权重\n",
    "            _, attn_w = model(X_batch_tensor)  # attn_w: (batch_size, num_features)\n",
    "            all_attn_weights.append(attn_w.cpu().numpy())\n",
    "    \n",
    "    # 计算所有样本的特征权重均值（按特征维度取平均）\n",
    "    all_attn_weights = np.concatenate(all_attn_weights, axis=0)  # (total_samples, num_features)\n",
    "    avg_attn_weights = np.mean(all_attn_weights, axis=0)  # (num_features,)：每个特征的平均权重\n",
    "    \n",
    "    # 整理为DataFrame并按权重降序排序\n",
    "    feat_attn_df = pd.DataFrame({\n",
    "        'feature_name': feature_names,\n",
    "        'avg_attn_weight': avg_attn_weights\n",
    "    }).sort_values(by='avg_attn_weight', ascending=False).reset_index(drop=True)\n",
    "    \n",
    "    return feat_attn_df\n",
    "\n",
    "# -------------------------- 2. 计算所有特征的平均权重（衔接已有代码）--------------------------\n",
    "# 注意：此处使用训练好的模型和标准化器（以交叉验证中最后一折的模型为例，或用最优折模型）\n",
    "# 若需更稳定结果，可使用所有折模型的权重均值，此处简化为单模型（实际可根据需求调整）\n",
    "# （假设之前交叉验证后，model和scaler为最后一折的最佳模型和标准化器）\n",
    "feat_attn_df = get_all_features_avg_attn(\n",
    "    model=model,  # 训练好的分类模型\n",
    "    scaler=scaler,  # 数据标准化器\n",
    "    X_all=X,  # 全量特征数据（原代码中的X）\n",
    "    feature_names=feature_cols,  # 所有特征的名称列表（原代码中的feature_cols）\n",
    "    device=DEVICE,  # 计算设备\n",
    "    batch_size=256\n",
    ")\n",
    "\n",
    "# 查看前10个和后10个特征的权重（验证结果合理性）\n",
    "print(\"所有特征平均注意力权重（前10名）：\")\n",
    "print(feat_attn_df.head(10))\n",
    "print(\"\\n所有特征平均注意力权重（后10名）：\")\n",
    "print(feat_attn_df.tail(10))\n",
    "print(f\"\\n总计特征数：{len(feat_attn_df)}\")\n",
    "\n",
    "# -------------------------- 3. 可视化所有参数的平均注意力权重 --------------------------\n",
    "# 设置中文字体（避免中文乱码）\n",
    "plt.rcParams['font.sans-serif'] = ['WenQuanYi Zen Hei', 'SimHei', 'Arial Unicode MS']\n",
    "plt.rcParams['axes.unicode_minus'] = False\n",
    "\n",
    "# 定义图表样式（横向柱状图，按权重降序排列，支持特征数较多的场景）\n",
    "fig, ax = plt.subplots(figsize=(10, len(feat_attn_df)*0.2))  # 高度随特征数自适应\n",
    "\n",
    "# 绘制横向柱状图（y轴为特征名，x轴为平均权重）\n",
    "bars = ax.barh(\n",
    "    y=feat_attn_df['feature_name'],  # y轴：特征名（按权重降序）\n",
    "    width=feat_attn_df['avg_attn_weight'],  # x轴：平均注意力权重\n",
    "    color=plt.cm.viridis(feat_attn_df['avg_attn_weight']/feat_attn_df['avg_attn_weight'].max()),  # 渐变色（权重越高颜色越深）\n",
    "    alpha=0.8,\n",
    "    edgecolor='white',\n",
    "    linewidth=0.5\n",
    ")\n",
    "\n",
    "# 添加数值标签（在每个柱子右侧显示权重值，仅显示前20个和后10个，避免拥挤）\n",
    "for i, (bar, weight) in enumerate(zip(bars, feat_attn_df['avg_attn_weight'])):\n",
    "    # 仅对前20个（高权重）和后10个（低权重）特征添加标签，中间特征省略（避免图表杂乱）\n",
    "    if i < 20 or i >= len(feat_attn_df) - 10:\n",
    "        ax.text(\n",
    "            x=bar.get_width() + 0.005,  # 标签在柱子右侧，留0.005间距\n",
    "            y=bar.get_y() + bar.get_height()/2,  # 标签垂直居中\n",
    "            s=f'{weight:.3f}',  # 权重值保留3位小数\n",
    "            ha='left',\n",
    "            va='center',\n",
    "            fontsize=8,\n",
    "            fontweight='bold',\n",
    "            color='darkslategrey'\n",
    "        )\n",
    "\n",
    "# 设置坐标轴与标题\n",
    "ax.set_xlabel('平均注意力权重', fontsize=12, fontweight='bold', labelpad=10)\n",
    "ax.set_ylabel('特征名称', fontsize=12, fontweight='bold', labelpad=10)\n",
    "ax.set_title(\n",
    "    f'所有参数的平均注意力权重（总计{len(feat_attn_df)}个特征）',\n",
    "    fontsize=14, fontweight='bold', pad=20\n",
    ")\n",
    "\n",
    "# 调整x轴范围（留10%余量，避免右侧标签超出画布）\n",
    "x_max = feat_attn_df['avg_attn_weight'].max()\n",
    "ax.set_xlim(0, x_max * 1.1)\n",
    "\n",
    "# 调整y轴标签字体大小（特征数多时自动缩小）\n",
    "ax.tick_params(axis='y', labelsize=8 if len(feat_attn_df) > 30 else 10)\n",
    "ax.tick_params(axis='x', labelsize=10)\n",
    "\n",
    "# 添加网格线（x轴方向，辅助判断权重大小）\n",
    "ax.grid(axis='x', alpha=0.3, linestyle='--', linewidth=0.5)\n",
    "ax.set_axisbelow(True)  # 网格线在柱子下方\n",
    "\n",
    "# 调整布局（避免标签被截断）\n",
    "plt.tight_layout()\n",
    "\n",
    "# 保存图片（高分辨率，支持放大查看细节）\n",
    "plt.savefig('all_features_avg_attn_weights.png', dpi=300, bbox_inches='tight')\n",
    "plt.close()\n",
    "\n",
    "print(\"\\n所有参数注意力权重图表已保存为：all_features_avg_attn_weights.png\")\n",
    "\n",
    "# -------------------------- 4. 可选：输出权重排序表（便于后续分析）--------------------------\n",
    "# 保存所有特征的权重排序结果到Excel，支持进一步筛选\n",
    "feat_attn_df['rank'] = range(1, len(feat_attn_df)+1)  # 添加排名列\n",
    "feat_attn_df.to_excel('all_features_attn_weight_ranking.xlsx', index=False)\n",
    "print(\"所有特征权重排序表已保存为：all_features_attn_weight_ranking.xlsx\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "bdb60924",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "BNN",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.23"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
